package org.lanqiao.netctoss.controller.tariff;

import java.io.IOException;
import java.util.List;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.lanqiao.netctoss.entity.Tariff;
import org.lanqiao.netctoss.service.impl.TariffServiceImpl;

/**
 * Servlet implementation class DetailServlet
 */
public class DetailServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public DetailServlet() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		int tar_no = Integer.parseInt(request.getParameter("tar_no"));
		/*TariffBuss tariffBuss = new TariffBussImpl();
		List<Tariff> tt = tariffBuss.selectTariffByno(new Tariff(tar_no));*/
		List<Tariff> tt = new TariffServiceImpl().selectTariffByno(new Tariff(tar_no));
		HttpSession session =request.getSession();
		session.setAttribute("tt", tt);
		request.getRequestDispatcher("../view/fee/fee_detail.jsp").forward(request, response);
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}
